< previous page page_76 next page >

Page 76
The last style is 2-DropDown List. This style allows you to select only from the list portion. Youre not allowed to type any text in the text portion of the combo box.
No matter which style you use, if you press a key in the text portion of the combo box, it will search for the letter youve typed. It will not perform a drill-down search; however, if you have five items that start with the letter J, for example, you can keep hitting the J key to cycle through all five items.
A good place for this control on the Employee Information form would be in place of the State text box. The user should choose a state from a list instead of typing in the value in a text box. If you make a user type in a value, he or she might type it incorrectly. If the user simply selects a value from a combo box, he or she cannot type it in wrong.
The combo box control has many of the same properties as the list box controlthe Sorted property, the List property, and the IntegralHeight property. Remember that a combo box is just a list box with a text box attached to it.
EXERCISE
Adding a Combo Box of State Codes
1. Click the State text box on the Employee Information form to give it focus.
2. Press the Delete key to delete that text box.
3. Add a combo box to the same location where the text box was positioned.
4. Set the Name property to cboState.
5. Set the style to 2-DropDown List. You want to use this style for lookup fields, where the user cant add new values to the list.
6. Set the Sorted property to True.
7. Now you can change the List property just like you did for the list box control and add the different state codes. See Figure 4.4 for an example of what this combo box might look like.

 
< previous page page_76 next page >

If you like this book, buy it!